package com.bookcycle.panda.webfront.config;

import com.baomidou.kisso.web.interceptor.SSOSpringInterceptor;
import com.bookcycle.panda.webfront.interceptor.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;


/**
 * @author Mason
 * @date 2018/3/25
 */
@ControllerAdvice
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter{
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       //registry.addInterceptor(new SSOPermissionInterceptor());
        //registry.addInterceptor(new SSOSpringInterceptor()).addPathPatterns("/**").excludePathPatterns("/home","/signIn","/login","/logout");

        //registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**").excludePathPatterns("/home","/signIn","/login","/logout");
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**").excludePathPatterns("/signIn","/login","/logout","/signUp","/register","/header");
        super.addInterceptors(registry);
    }
}
